
<%@ taglib uri="http://jakarta.apache.org/struts/tags-html" prefix="html" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-bean" prefix="bean" %>
<%@ taglib uri="http://jakarta.apache.org/struts/tags-logic" prefix="logic" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"    pageEncoding="UTF-8"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<link rel="stylesheet" type="text/css" href="<%= request.getContextPath() %>/css/sampleForm.css" />
	<link rel="stylesheet" type="text/css" href="<%= request.getContextPath() %>/css/me.css" />	
	<link rel="stylesheet" type="text/css" href="<%= request.getContextPath() %>/common/css/help/help.css" />


<title>Insert title here</title>

<script type="text/javascript" >
function sendtomainform(lineNumber) {
	var	whCode		 	= 	document.getElementById("whCode").value;
	var	shelfCode	  	=	document.getElementById("shelfCode").value;	
	var	statusReceive 	= 	document.getElementById("statusReceive").value;
	var	departCode	  	=	document.getElementById("departCode").value;
	var	projectCode 	=	document.getElementById("projectCode").value;
	var	allocateCode	=	document.getElementById("allocateCode").value;
	var	myDescription	=	document.getElementById("myDescription").value;
	var	poRefNo			=	document.getElementById("poRefNo").value;
	var	netAmount		=	document.getElementById("netAmount").value;
	var	homeAmount		=	document.getElementById("homeAmount").value;

	opener.document.getElementById("lineItem_whCode"+lineNumber).value = whCode;
	opener.document.getElementById("lineItem_shelfCode"+lineNumber).value = shelfCode;
		
	opener.document.getElementById("lineItem_statusReceive"+lineNumber).value = statusReceive;
	opener.document.getElementById("lineItem_departCode"+lineNumber).value = departCode;
	opener.document.getElementById("lineItem_projectCode"+lineNumber).value = projectCode;
	opener.document.getElementById("lineItem_allocateCode"+lineNumber).value = allocateCode;
	opener.document.getElementById("lineItem_myDescription"+lineNumber).value = myDescription;
	opener.document.getElementById("lineItem_poRefNo"+lineNumber).value = poRefNo;
	opener.document.getElementById("lineItem_netAmount"+lineNumber).value = netAmount;
	opener.document.getElementById("lineItem_homeAmount"+lineNumber).value = homeAmount;							

	var link = "<a href='#' target='name' onclick=modalWin('/ittl/apinvoice/apinvoice2.do?mode=moreDetailsShow";
	link +="&lineItem_whCode="+whCode;
	link +="&lineItem_shelfCode="+shelfCode;	
	link +="&lineItem_statusReceive="+statusReceive;
	link +="&lineItem_departCode="+departCode;
	link +="&lineItem_projectCode="+projectCode;
	link +="&lineItem_allocateCode="+allocateCode;
	link +="&lineItem_myDescription="+myDescription;
	link +="&lineItem_poRefNo="+poRefNo;
	link +="&lineItem_netAmount="+netAmount;
	link +="&lineItem_homeAmount="+homeAmount;
	link +="&lineNumber="+lineNumber;
	link +="'); return false;>เพิ่ม2 </a>";	
	opener.document.getElementById("lineItem_moreDetails"+lineNumber).innerHTML = link;
	
	window.close(); 
}
function getAmount(lineNumber) {
	document.getElementById("netAmount").value 	= 	opener.document.getElementById("amount"+lineNumber).value;
	document.getElementById("homeAmount").value	=	opener.document.getElementById("amount"+lineNumber).value;
	
}
</script>


</head>
<body onload="getAmount(${lineNumber})">			
	<div id="userPw01">
	<fieldset>
		<legend><b>รายละเอียดอื่นๆ</b></legend>
		   <center> 
		   <table border="0" >
			<tr>
				<td width="160" align="right">สถานะการรับสินค้า:</td>
				<td width="140"><html:select property="statusReceive" value="${statusReceive }" styleId="statusReceive" style="width:150px">
									<html:option value="0">ปรกติ</html:option>
									<html:option value="1">ของเกิน</html:option>
									<html:option value="2">ของแถม</html:option>
									<html:option value="3">ของสูญหาย</html:option>
									<html:option value="4">ของชำรุดจากขนส่ง</html:option>
									<html:option value="5">ขนส่งขาดส่ง</html:option>
									<html:option value="6">ของชำรุดจากเจ้าหนี้</html:option>									
								</html:select>		
								</td>
								
				<td width="160" align="right">เลขที่ใบสั่งซื้อ:</td>
				<td width="140"><html:text property="poRefNo" value="${poRefNo }" styleId="poRefNo" /></td>
				
			</tr>		   		   
			<tr>
				<td width="160"align="right">แผนก:</td>
				<td width="140">
								<html:select property="departCode" value="${departCode }" styleId="departCode" style="width:150px" >
									<html:optionsCollection name="departmentList" label="code" value="code" />
								</html:select></td>
								
				<td width="160"align="right">ยอดเงินสุทธิ:</td>
				<td width="160"><html:text property="netAmount" styleId="netAmount" value="${netAmount }" style="text-align:right" readonly="true" /></td>
									
			</tr>
			<tr>
				<td width="160"align="right">โครงการ:</td>
				<td width="140"><html:select property="projectCode" value="${projectCode }" styleId="projectCode" style="width:150px">
									<html:optionsCollection name="projectList" label="code" value="code" />
								</html:select> 									
				</td>
								
				<td width="160"align="right">ยอดเงินบาทสุทธิ:</td>
				<td width="160">
					<html:text property="homeAmount" styleId="homeAmount" value="${homeAmount }" style="text-align:right" readonly="true" />
				</td>

									
			</tr>
			<tr>			
 				<td align="right">การจัดสรร:</td>
 				<td colspan="3">
 					<html:select property="allocateCode" value="${allocateCode }" styleId="allocateCode" style="width:150px">
									<html:option value=""></html:option>
					</html:select> 					
 				</td> 				 				 				 										 				 		
 			</tr>
			<tr>			
 				<td align="right">คลัง:</td>
 				<td colspan="3">
 					<html:select property="whCode" value="${whCode }" styleId="whCode" style="width:150px">
						<html:optionsCollection name="warehouseList" label="name" value="code" />									
					</html:select> 
 				</td> 				 				 				 										 				 		
 			</tr>
			<tr>			
 				<td align="right">ที่เก็บ:</td>
 				<td colspan="3">
 					<html:select property="shelfCode" value="${shelfCode }" styleId="shelfCode" style="width:150px">
						<html:optionsCollection name="shelfList" label="name" value="code" />
					</html:select> 					
 				</td> 				 				 				 										 				 		
 			</tr> 			 									
			<tr>
				<td align="right">คำอธิบายรายการ:</td>
				<td colspan="3"><html:text property="myDescription" styleId="myDescription" value="${myDescription }" size="70"/></td>
				
			</tr> 			
 			<tr>
 				<td align="right" colspan="4"><html:submit value="ตกลง" onclick="sendtomainform(${lineNumber});" /> </td>
 			</tr>							 			 				 						 				
		</table>
		</center>
     </fieldset></div>		
		

</body>
</html>